package com.bolang.onlycode.demo.designPatterns.builder;

public class Client {
    public static void main(String[] args) {
     Computer computer= new  Computer.Builder("因特二","三星")
             .setDisplay("三星二十四寸")
             .setKeyboard("罗技")
             .setUsbCount(2)
             .build();
        ComputerDirector director=new ComputerDirector();//1
        ComputerBuilder builder=new MacComputerBuilder("I5处理器","三星125");//2
        director.makeComputer(builder);//3
        Computer1 macComputer=builder.getComputer1();//4
        System.out.println("mac computer:"+macComputer.toString());

        ComputerBuilder lenovoBuilder=new LenovoComputerBuilder("I7处理器","海力士222");
        director.makeComputer(lenovoBuilder);
        Computer1 lenovoComputer=lenovoBuilder.getComputer1();
        System.out.println("lenovo computer:"+lenovoComputer.toString());
    }
}
